$(function() {
    var dom = document.getElementById("moldCostDiv");
    var myChart = echarts.init(dom);
    var app = {};
    // option
    option = {
        tooltip: {
          trigger: 'axis'
        },
        legend: {
            data: ['浇筑', '压铸', '制芯'],
            textStyle: {
            color: '#ccc'
            }
        },
        grid: {
          left: '3%',
          right: '4%',
          bottom: '5%',
          containLabel: true
        },
        xAxis: {
          type: 'category',
          boundaryGap: false,
          axisLine: {
                lineStyle: {
                    color: '#ccc'
                }
            },
            axisLabel: {interval:0,rotate: 40 },
          data: ['2022-01','2022-02','2022-03','2022-04','2022-05','2022-06']
        },
        yAxis: {
          type: 'value',
          axisLine: {
            lineStyle: {
                color: '#ccc'
            }
        }
        },
        series: [
          {
            name: '浇筑',
            type: 'line',
            stack: 'Total',
            data: [120, 132, 101, 134, 90, 230, 210]
          },
          {
            name: '压铸',
            type: 'line',
            stack: 'Total',
            data: [220, 182, 191, 234, 290, 330, 310]
          },
          {
            name: '制芯',
            type: 'line',
            stack: 'Total',
            data: [150, 232, 201, 154, 190, 330, 410]
          }
        ]
      };
    if (option && typeof option === "object") {
        myChart.setOption(option, true);
    }
})